package dwei.textwrap
{
	import flash.events.Event;
	import flash.events.EventDispatcher;

	[Event(name="change", type="flash.events.Event")]
	public class WrapperFormat extends EventDispatcher
	{
//============================================================================
//PROPERTY
//============================================================================
		private var _indent:int;
		private var _leading:int;
		private var _letterGap:int;
		private var _paddingLeft:int;
		private var _paddingRight:int;
		private var _paddingTop:int;
		private var _paddingBottom:int;
		private var _fontSize:int;
		private var _fontColor:uint;
		private var _fontFamily:String;
		private var _fontBold:Boolean;
		private var _fontItalic:Boolean;
		private var _fontUnderLine:Boolean;
//============================================================================
//CONSTRUCTOR
//============================================================================
		public function WrapperFormat()
		{
			_indent = 0;
			_leading = 0;
			_letterGap = 0;
			_paddingLeft = _paddingRight = _paddingTop = _paddingBottom = 0;
			_fontSize = 12;
			_fontColor = 0x000000;
			_fontFamily = "Times New Roman";
			_fontBold = _fontItalic = _fontUnderLine = false;
		}
//============================================================================
//GETTER/SETTER
//============================================================================

		/**
		 * 首行缩进
		 */
		public function get indent():int
		{
			return _indent;
		}

		/**
		 * @private
		 */
		public function set indent(value:int):void
		{
			if (value == _indent) return;
			_indent = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 行距
		 */
		public function get leading():int
		{
			return _leading;
		}

		/**
		 * @private
		 */
		public function set leading(value:int):void
		{
			if (value == _leading) return;
			_leading = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 字符间距
		 */
		public function get letterGap():int
		{
			return _letterGap;
		}

		/**
		 * @private
		 */
		public function set letterGap(value:int):void
		{
			if (value == _letterGap) return;
			_letterGap = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 左边距
		 */
		public function get paddingLeft():int
		{
			return _paddingLeft;
		}

		/**
		 * @private
		 */
		public function set paddingLeft(value:int):void
		{
			if (value == _paddingLeft) return;
			_paddingLeft = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 右边距
		 */
		public function get paddingRight():int
		{
			return _paddingRight;
		}

		/**
		 * @private
		 */
		public function set paddingRight(value:int):void
		{
			if (value == _paddingRight) return;
			_paddingRight = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 上边距
		 */
		public function get paddingTop():int
		{
			return _paddingTop;
		}

		/**
		 * @private
		 */
		public function set paddingTop(value:int):void
		{
			if (value == _paddingTop) return;
			_paddingTop = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 下边距
		 */
		public function get paddingBottom():int
		{
			return _paddingBottom;
		}

		/**
		 * @private
		 */
		public function set paddingBottom(value:int):void
		{
			if (value == _paddingBottom) return;
			_paddingBottom = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 文字大小
		 */
		public function get fontSize():int
		{
			return _fontSize;
		}

		/**
		 * @private
		 */
		public function set fontSize(value:int):void
		{
			if (value == _fontSize) return;
			_fontSize = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 文字颜色
		 */
		public function get fontColor():uint
		{
			return _fontColor;
		}

		/**
		 * @private
		 */
		public function set fontColor(value:uint):void
		{
			if (value == _fontColor) return;
			_fontColor = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 文字字体
		 */
		public function get fontFamily():String
		{
			return _fontFamily;
		}

		/**
		 * @private
		 */
		public function set fontFamily(value:String):void
		{
			if (value == _fontFamily) return;
			_fontFamily = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 文字是否加粗
		 */
		public function get fontBold():Boolean
		{
			return _fontBold;
		}

		/**
		 * @private
		 */
		public function set fontBold(value:Boolean):void
		{
			if (value == _fontBold) return;
			_fontBold = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 文字是否为斜体
		 */
		public function get fontItalic():Boolean
		{
			return _fontItalic;
		}

		/**
		 * @private
		 */
		public function set fontItalic(value:Boolean):void
		{
			if (value == _fontItalic) return;
			_fontItalic = value;
			dispatchEvent(new Event(Event.CHANGE));
		}

		/**
		 * 文字是否有下划线
		 */
		public function get fontUnderLine():Boolean
		{
			return _fontUnderLine;
		}

		/**
		 * @private
		 */
		public function set fontUnderLine(value:Boolean):void
		{
			if (value == _fontUnderLine) return;
			_fontUnderLine = value;
			dispatchEvent(new Event(Event.CHANGE));
		}


	}
}